﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo4
{
    class Program
    {
        static void Main(string[] args)
        {
            string s1 = "   ";
            string s2 = null;
            string s3 = "";
            string s4 = "1";
            Console.WriteLine(StringUtil.IsNull(s1));
            Console.WriteLine(StringUtil.IsNull(s2));
            Console.WriteLine(StringUtil.IsNull(s3));
            Console.WriteLine(StringUtil.IsNull(s4));

            int[] arr1 = null;
            int[][] arr2 = null;
            char[] chars = { };
            bool[][] bools = { };
            double[] doubles1 = { 1.2 };
            string[][] strs1 = new string[5][];
            Console.WriteLine(ArrayUtil.IsNull(arr1));
            Console.WriteLine(ArrayUtil.IsNull(arr2));
            Console.WriteLine(ArrayUtil.IsNull(chars));
            Console.WriteLine(ArrayUtil.IsNull(bools));
            Console.WriteLine(ArrayUtil.IsNull(doubles1));
            Console.WriteLine(ArrayUtil.IsNull(strs1));
        }
        class ArrayUtil
        {
            public static bool IsNull(Object objs)
            {
                Array a = objs as Array;
                return objs == null ? true : a.Length == 0 ? true : false;
            }
        }
        static class StringUtil
        {
            public static bool IsNull(string s)
            {
                return s == null ? true : s.Trim().Length == 0 ? true : false;
            }
        }
    }
}
